home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / vector.lha / vector / vectest.c < prev    next >
C/C++ Source or Header  |  1991-11-23  |  687b  |  31 lines

  1. //% CC -I. vectest.c -o vectest -lm
  2. #include "hvector.h"
  3. #include "hmatrix.h"
  4.  
  5. main() {
  6.     Vector fnull(0,0,0),
  7.      fcomponent(1,2,3),
  8.      fcopy(fcomponent);
  9.  
  10.     cout << "Null vector = " << fnull << endl
  11.      << "Componentwise constructor = " << fcomponent << endl
  12.      << "Reference constructor = " << fcopy << endl;
  13.  
  14.     if (fcomponent != fcopy)
  15.     cout << "fcomponent != fcopy (bogus)\n";
  16.  
  17.     HVector h(fcomponent),
  18.         hassign = fcomponent;
  19.  
  20.     HVector hequal;
  21.     hequal = fcomponent;
  22.  
  23.     cout << "Homogenous h(v) = " << h << endl
  24.      << "h = v = " << hassign << endl
  25.      << "h; h = v = " << hequal << endl;
  26.  
  27.     Vector vassign = h;
  28.  
  29.     cout << "Assign back v = h = " << vassign << endl;;
  30. }
  31.